<form id="choose" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('年级/班级')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="grade,classes">
                <select class="form-control grade" name="grade_id" data-url="grade/cxSelect"></select>
                <select class="form-control classes" name="classes_id" data-url="classes/cxSelect?type=1&school_id={$school_id}" data-query-name="grade_id"></select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择学生')}:</label>
        <div class="col-xs-12 col-sm-8">
            <span class="check">
                <input id="check_all" name="check_all" type="checkbox" >
                <label for="check_all">全选</label>
            </span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <div id="student_list"></div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input type="hidden" name="class_id" value="{$class_id}" class="class_id">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>

<script type="text/html" id="student_tpl">
    <%for(var i=0; i< data.length; i++){%>
    <span class="check">
            <input id="student_<%=data[i].id%>" class="student" name="student[]" type="checkbox" value="<%=data[i].id%>">
            <label for="student_<%=data[i].id%>"><%=data[i].name%></label>
        </span>
    <%}%>
</script>
